home *** CD-ROM | disk | FTP | other *** search
/ Kit PC World De Ampliacion De Windows 95 / Kit PC World de ampliacion de Windows 95.iso / internet / sweeper / samples / olecon~1 / include / localsrv.h < prev    next >
Text File  |  1995-11-25  |  3KB  |  68 lines

  1. //=--------------------------------------------------------------------------=
  2. // LocalServer.H
  3. //=--------------------------------------------------------------------------=
  4. // Copyright  1995  Microsoft Corporation.  All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. //
  12. // global routines that are specific to the inproc server itself, such as
  13. // registration, object creation, object specification, etc...
  14. //
  15. #ifndef _LOCALSERVER_H_
  16.  
  17. void      InitializeLibrary(void);
  18. void      UninitializeLibrary(void);
  19. BOOL      RegisterData(void);
  20. BOOL      UnregisterData(void);
  21. BOOL      CheckForLicense();
  22.  
  23. // global variables that various people use to get information about the control.
  24. //
  25. extern char g_szLibName [];
  26. extern const CLSID *g_pLibid;
  27.  
  28. //=--------------------------------------------------------------------------=
  29. // Global object information table
  30. //=--------------------------------------------------------------------------=
  31. // for each object in your application, you have an entry in this table.  they
  32. // do not necessarily have to be CoCreatable, but if they are used, then they
  33. // should reside here.  use the macros to fill in this table.
  34. //
  35. typedef struct tagOBJECTINFO {
  36.  
  37.     unsigned short usType;
  38.     void          *pInfo;
  39.  
  40. } OBJECTINFO;
  41.  
  42. extern OBJECTINFO g_ObjectInfo[];
  43.  
  44. //=--------------------------------------------------------------------------=
  45. // these things are used to set up our objects in our global object table
  46. //
  47. #define OI_UNKNOWN       0
  48. #define OI_AUTOMATION    1
  49. #define OI_CONTROL       2
  50. #define OI_PROPERTYPAGE  3
  51. #define OI_BOGUS         0xffff
  52.  
  53. #define OBJECTISCREATABLE(index)  (((UNKNOWNOBJECTINFO *)(g_ObjectInfo[(index)]).pInfo)->rclsid != NULL)
  54. #define ISEMPTYOBJECT(index)      (g_ObjectInfo[index].usType == OI_BOGUS)
  55.  
  56. // these are the macros you should use to fill in the table.  Note that the name
  57. // must be exactly the same as that used in the global structure you created
  58. // for this object.
  59. //
  60. #define AUTOMATIONOBJECT(name) { OI_AUTOMATION,   (void *)&(name##Object) }
  61. #define CONTROLOBJECT(name)    { OI_CONTROL,      (void *)&(name##Control) }
  62. #define PROPERTYPAGE(name)     { OI_PROPERTYPAGE, (void *)&(name##Page) }
  63. #define EMPTYOBJECT            { OI_BOGUS, NULL }
  64.  
  65. #define _LOCALSERVER_H_
  66. #endif // _LOCALSERVER_H_
  67.  
  68.